﻿using IServices;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using YL.Core.Dto;
using YL.Core.Entity;
using YL.Core.Entity.Fluent.Validation;
using YL.Core.Entity.Meter;
using YL.NetCore.Attributes;
using YL.NetCore.NetCoreApp;
using YL.Utils.Extensions;
using YL.Utils.Pub;
using YL.Utils.Table;

namespace Method.SmartMeter.Controllers
{
    public class InspectionHistoryController : BaseController
    {
        private readonly IMeter_InspectionHistoryServices _inspectionHistoryServices;

        public InspectionHistoryController(IMeter_InspectionHistoryServices inspectionHistoryServices)
        {
            _inspectionHistoryServices = inspectionHistoryServices;
        }

        [HttpGet]
        [CheckMenu]
        public IActionResult Index()
        {
            return View();
        }

        [HttpPost]
        [OperationLog(LogType = LogType.select)]
        public ContentResult List([FromForm] Bootstrap.BootstrapParams bootstrap)
        {
            bootstrap.UserId = UserDto.UserId;
            var sd = _inspectionHistoryServices.PageList(bootstrap);
            return Content(sd);
        }
    }
}